using System.Collections.Generic;
using UnityEngine;

namespace HEFramework
{
    /// <summary>
    /// Attribute data,Attribute.xlsx
    /// </summary>
    public class DRAttribute:IData
    {
        
        /// <summary>
        /// 序号  different
        /// </summary>
        public int ID { get; protected set; }
        /// <summary>
        /// 名字  outputKey
        /// </summary>
        public string Name { get; protected set; }
        /// <summary>
        /// AB路径  
        /// </summary>
        public string ABPath { get; protected set; }
        /// <summary>
        /// AB昵称  
        /// </summary>
        public string ABName { get; protected set; }
        /// <summary>
        /// 类型  
        /// </summary>
        public int Type { get; protected set; }
        /// <summary>
        /// 最大生命  
        /// </summary>
        public int X_HP { get; protected set; }
        /// <summary>
        /// 最大魔法  
        /// </summary>
        public int X_MP { get; protected set; }
        /// <summary>
        /// 生命恢复  
        /// </summary>
        public int REC_HP { get; protected set; }
        /// <summary>
        /// 魔法恢复  
        /// </summary>
        public int REC_MP { get; protected set; }
        /// <summary>
        /// 攻击  
        /// </summary>
        public int P_ATK { get; protected set; }
        /// <summary>
        /// 防御  
        /// </summary>
        public int P_DEF { get; protected set; }
        /// <summary>
        /// 法术  
        /// </summary>
        public int M_ATK { get; protected set; }
        /// <summary>
        /// 法抗  
        /// </summary>
        public int M_DEF { get; protected set; }
        /// <summary>
        /// 攻击速度  
        /// </summary>
        public int P_ATK_SP { get; protected set; }
        /// <summary>
        /// 法术急速  
        /// </summary>
        public int M_ATK_SP { get; protected set; }
        /// <summary>
        /// 移动速度（厘米/S）  
        /// </summary>
        public int MV_SP { get; protected set; }
        /// <summary>
        /// 攻击范围（厘米）  
        /// </summary>
        public int P_ATK_RAG { get; protected set; }
        /// <summary>
        /// 基础攻击间隔（毫秒）  
        /// </summary>
        public int P_ATK_BAT { get; protected set; }
        /// <summary>
        /// 攻击前摇（毫秒）  
        /// </summary>
        public int P_ATK_DP { get; protected set; }
        /// <summary>
        /// 攻击后摇（毫秒）  
        /// </summary>
        public int P_ATK_DBS { get; protected set; }
        /// <summary>
        /// 法术前摇（毫秒）  
        /// </summary>
        public int M_ATK_CP { get; protected set; }
        /// <summary>
        /// 法术后摇（毫秒）  
        /// </summary>
        public int M_ATK_CBS { get; protected set; }
        /// <summary>
        /// 搜索范围（厘米）  
        /// </summary>
        public int SEC_RAG { get; protected set; }
        /// <summary>
        /// 索敌间隔（毫秒）  
        /// </summary>
        public int SEC_F { get; protected set; }
        /// <summary>
        /// 身体范围（厘米）  
        /// </summary>
        public int B_RAG { get; protected set; }
        /// <summary>
        /// 身高（厘米）  
        /// </summary>
        public int B_H { get; protected set; }
        /// <summary>
        /// 仇恨  
        /// </summary>
        public int TRT { get; protected set; }
        /// <summary>
        /// 级别ID  
        /// </summary>
        public int LV_ID { get; protected set; }
        /// <summary>
        /// 级别  
        /// </summary>
        public int LV { get; protected set; }
        /// <summary>
        /// 最大级别  
        /// </summary>
        public int X_LV { get; protected set; }
        /// <summary>
        /// 阶级ID  
        /// </summary>
        public int RANK_ID { get; protected set; }
        /// <summary>
        /// 阶级  
        /// </summary>
        public int RANK { get; protected set; }
        /// <summary>
        /// 最大阶级  
        /// </summary>
        public int X_RANK { get; protected set; }
        /// <summary>
        /// 攻击效果  
        /// </summary>
        public int P_ATK_E { get; protected set; }
        /// <summary>
        /// 技能组  
        /// </summary>
        public int[] SKILLS { get; protected set; }

        
        public void ParseDataRow(string input)
        {
            string[] text = input.Split('	');
            int index = 0;
        
            ID = int.Parse(text[index++]);
            Name = DataTableExtension.GetStringFromKey(text[index++]);
            ABPath = text[index++];
            ABName = text[index++];
            Type = int.Parse(text[index++]);
            X_HP = int.Parse(text[index++]);
            X_MP = int.Parse(text[index++]);
            REC_HP = int.Parse(text[index++]);
            REC_MP = int.Parse(text[index++]);
            P_ATK = int.Parse(text[index++]);
            P_DEF = int.Parse(text[index++]);
            M_ATK = int.Parse(text[index++]);
            M_DEF = int.Parse(text[index++]);
            P_ATK_SP = int.Parse(text[index++]);
            M_ATK_SP = int.Parse(text[index++]);
            MV_SP = int.Parse(text[index++]);
            P_ATK_RAG = int.Parse(text[index++]);
            P_ATK_BAT = int.Parse(text[index++]);
            P_ATK_DP = int.Parse(text[index++]);
            P_ATK_DBS = int.Parse(text[index++]);
            M_ATK_CP = int.Parse(text[index++]);
            M_ATK_CBS = int.Parse(text[index++]);
            SEC_RAG = int.Parse(text[index++]);
            SEC_F = int.Parse(text[index++]);
            B_RAG = int.Parse(text[index++]);
            B_H = int.Parse(text[index++]);
            TRT = int.Parse(text[index++]);
            LV_ID = int.Parse(text[index++]);
            LV = int.Parse(text[index++]);
            X_LV = int.Parse(text[index++]);
            RANK_ID = int.Parse(text[index++]);
            RANK = int.Parse(text[index++]);
            X_RANK = int.Parse(text[index++]);
            P_ATK_E = int.Parse(text[index++]);
            SKILLS = DataTableExtension.ParseIntArr(text[index++]);

        }
        
        private void AvoidJIT()
        {
            new Dictionary<int, DRAttribute>();
        }
    }
}